package com.hongyue.dey05;

public class Demo {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName() + i);
            }
        }, "线程1：");
        t.start();

        Thread t1 = new Thread(new MyThread(), "线程2：");
        t1.start();

        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + i);
        }
    }
}
